/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-10-08 09:28:14
 * @LastEditors: rendc
 * @LastEditTime: 2024-10-08 09:28:20
 */
class Student implements Comparable<Student> {
    private String name;
    private int score;

    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    public String getName() {
        return name;
    }

    public int getScore() {
        return score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }

    @Override
    public int compareTo(Student other) {
        if (this.getName().equals("tom")) {
            return -1; // tom 总是在前面
        } else if (other.getName().equals("tom")) {
            return 1; // 其他学生在 tom 后面
        } else {
            return Integer.compare(this.getScore(), other.getScore());
        }
    }
}